package com.jg.utils.Thread;

/**
 * 创建两个继承Thread类的实体类然后重写run方法实现多线程操作
 */
class Test2 {
    public static void main(String[] args) {
        new Game().start();
        new Music().start();
    }

}
class Game extends Thread {
    @Override
    public void run() {
        day();
    }
    public void day(){
        while (true)
            System.out.println("打游戏");
    }
}

class Music extends Thread {
    @Override
    public void run() {
        while (true)
            System.out.println("听音乐");
    }
}
